package com.diversitopia.ui;

import java.awt.GraphicsConfiguration;
import java.awt.HeadlessException;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Analyzer extends javax.swing.JFrame {
	private javax.swing.JLabel applicationTitle;
	private javax.swing.JComboBox reportUsers;
	private javax.swing.JLabel reportUsersLabel;    
	final static int extraWindowWidth = 100;

	/**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Analyzer().setVisible(true);
            }
        });
    }

    private void initComponents(Container pane) {
    	applicationTitle = new javax.swing.JLabel("Report Analyzer");
    	reportUsersLabel = new javax.swing.JLabel("Report Users");
    	reportUsers = new javax.swing.JComboBox();
    	
    	setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    	JTabbedPane tabbedPane = new JTabbedPane();    
    	JPanel userOptions = new JPanel() {
    		public Dimension getPreferredSize() {
    	        Dimension size = super.getPreferredSize();
    	        size.width += extraWindowWidth;
    	        return size;
    	    }
    	};
    	JPanel userStocks = new JPanel() {
    		public Dimension getPreferredSize() {
    	        Dimension size = super.getPreferredSize();
    	        size.width += extraWindowWidth;
    	        return size;
    	    }
    	};
    	JPanel userReports = new JPanel() {
    		public Dimension getPreferredSize() {
    	        Dimension size = super.getPreferredSize();
    	        size.width += extraWindowWidth;
    	        return size;
    	    }
    	};
    	//setLayout(layout);
    	userOptions.add(applicationTitle,BorderLayout.EAST);
    	userOptions.add(reportUsersLabel,BorderLayout.WEST);
    	userOptions.add(reportUsers,BorderLayout.WEST);
    	
    	tabbedPane.addTab("User Options", new UserOptionsDisplay());
    	tabbedPane.addTab("User Stocks", userStocks);
    	tabbedPane.addTab("User Reports", userReports);
    	pane.add(tabbedPane, BorderLayout.CENTER);
    }
    private void loadReportUsers() {
    	//stub
    	reportUsers.addItem("Shawn Stott");
    	reportUsers.addItem("Bobbi Stott");
    	reportUsers.addItem("Louise");
    }
	public Analyzer() throws HeadlessException {
		super();
		initComponents(this.getContentPane());
		loadReportUsers();
		//this.pack();
		this.setSize(800, 600);
		this.setVisible(true);
		// TODO Auto-generated constructor stub
	}

	public Analyzer(GraphicsConfiguration arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
	}

	public Analyzer(String arg0, GraphicsConfiguration arg1) {
		super(arg0, arg1);
		// TODO Auto-generated constructor stub
	}

	public Analyzer(String arg0) throws HeadlessException {
		super(arg0);
		// TODO Auto-generated constructor stub
	}	

}
